home *** CD-ROM | disk | FTP | other *** search
- Path: wariat.org!news
- From: balif@nacs.net (balif)
- Newsgroups: comp.lang.c
- Subject: Array pointing to Dynamic list thingie
- Date: 16 Feb 1996 20:44:00 GMT
- Organization: -[Kender Maulers]-
- Message-ID: <4g2qag$pmb@wariat.wariat.org>
- NNTP-Posting-Host: dyn-30.nacs.net
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- The code i'm workin with is in unix/linux CC
-
- I am trying to write a routine for a mud. What I need is an array that has X
- number of trainer mobiles in the mud. so for instance,
- trainer_mob[3] would reference number 3. Then I want to have that point to
- a list of numbers that represent the skills taught. So for instance
- for (i=1;i<10;++i)
- printf("Skill: %d/n",trainer_mob[3][i]);
- would print out a list of skills that trainer mob 3 has. But I do not know
- how long that list will be. I want something where I can say like
- struct trainer_mob
- {
- int skills_taught[10];
- } mob_teaches {
- {
- 150, 153, 154,
- },
- {
- 34, 53, 100, 154,
- },
- {
- 53, 130,
- }
- }
-
- or something along that lines. I refer to circlemud3.0 "Fight.C" when it
- defines the attack types. I want to be able to enter as many values as I
- want then later be able to scan through them to see if the trainer teaches
- the skill requested and branch to either train the person or give a message
- saying "No dice." how would i go about doing this? thanks in advance
-
-
- --
- ---Balif
- .--------------------------------------------------------.
- |When You Think You've Tried Every Road ... Every Avenue;|
- |Take One more Look, in what you've found Old; |
- |And in it You'll find something New --Depeche Mode |
- \_Balif@nacs.net___http://www.nacs.net/~balif____________/
-
-
-